import {
  axios
} from "../axios/index";
// import qs from "qs";

export function getAction(url: string, parameter: any) {
  return axios({
    url: url,
    method: "get",
    params: parameter,
  });
}

// export function postAction(url: string, parameter: any) {
//   return axios.post(
//     url,
//     qs.stringify(parameter, {
//       allowDots: true,
//     })
//   );
// }
export function getForm(url: string, data: any, parameter: any) {
  return axios({
    url: url,
    method: "get",
    data: data,
    params: parameter,
  });
}
export function postForm(url: string, data: any) {
  return axios({
    url: url,
    method: "post",
    data: data,
  });
}

export function put(url: string, parameter: any, data: any) {
  return axios({
    url: url,
    method: "put",
    params: parameter,
    data,
  });
}

export function del(url: string) {
  return axios({
    url: url,
    method: "delete",
  });
}
export function postFormJson(url: string, data: any) {
  return axios({
    url: url,
    method: "post",
    data: data,
  });
}


export function postmultipartBlob(url: string, data: any) {
  return axios({
    url: url,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
  })
}